<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>编辑商品</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  #parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid layui-form" wid100>
  <input type="hidden" name="id" value="$!{id}"/>
  <input type="hidden" name="parentId" value="$!{parentId}"/>
  <div class="layui-row">
    #if($parentName)
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">上级类型</label>
        <div class="layui-form-mid layui-word-aux">$!{parentName}($!{parentCode})</div>
      </div>
    </div>
    #elseif($id)
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-form-mid layui-word-aux">$!{classifyName}</div>
      </div>
    </div>
    #else
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
          <select name="classify">
            #foreach($item in $classifyList)
            <option value="$!{item.index()}" $!{utils.eq($item.index(),$classify,'selected')}>$!{item.note()}</option>
            #end
          </select>
        </div>
      </div>
    </div>
    #end
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">商品类型Code</label>
        <div class="layui-input-block">
          <input type="text" name="code" lay-verify="required" placeholder="请输入商品类型Code" autocomplete="off" class="layui-input" value="$!{code}">
        </div>
      </div>
    </div>
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">商品类型名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" lay-verify="required" placeholder="请输入商品类型名称" autocomplete="off" class="layui-input" value="$!{name}">
        </div>
      </div>
    </div>
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">优先级</label>
        <div class="layui-input-block">
          <input type="text" name="priority" lay-verify="required" placeholder="请输入优先级" autocomplete="off" class="layui-input" value="$!{priority}">
        </div>
      </div>
    </div>
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
          <select name="state">
            #foreach($item in $stateList)
            <option value="$!{item.index()}" $!{utils.eq($item.index(),$state,'selected')}>$!{item.note()}</option>
            #end
          </select>
        </div>
      </div>
    </div>
  </div><!-- /.layui-row -->
  <div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  </div>
</div>
#parse('/footFiles.html')
<script>
layui.config({
  base: '$!{webRoot}/layuiadmin/' //静态资源所在路径
  ,webRoot:'$!{webRoot}'
}).extend({
  index: 'lib/index' //主入口模块
}).use(['index', 'form', 'upload'], function(){
  var $ = layui.$
  ,form = layui.form
  ,upload = layui.upload ;
  
  upload.render({
    elem: '#layuiadmin-upload'
    ,url: '$!{webRoot}/team_pay/simple/goods/uploadImg.do'
    ,accept: 'images'
    ,method: 'get'
    ,acceptMime: 'image/*'
    ,done: function(res){
  	  if(res && res.code == 200){
        $('input[name="imgs"]').val(res.body)
        $('#goodsImg').attr("src",'$!{resDomain}'+res.body);
  	  }else{
  		  layer.msg('上传失败',{icon: 2});
  	  }
    }
  });
})
</script>
</body>
</html>